package cn.snmp.mutual.org.opennms.protocols.snmp;

public class SnmpPduRequest extends SnmpPduPacket {
    public SnmpPduRequest() {
        super(160);
    }

    public SnmpPduRequest(final SnmpPduRequest second) {
        super(second);
    }

    public SnmpPduRequest(final int command) {
        super(command);
    }

    public SnmpPduRequest(final int command, final SnmpVarBind[] vars) {
        super(command, vars);
    }

    public int getErrorStatus() {
        return super.m_errStatus;
    }

    public void setErrorStatus(final int status) {
        super.m_errStatus = status;
    }

    public int getErrorIndex() {
        return super.m_errIndex;
    }

    public void setErrorIndex(final int ndx) {
        super.m_errIndex = ndx;
    }

    public void fix() {
        if (super.m_errStatus != 0 && super.m_errIndex != 0) {
            this.removeVarBindAt(super.m_errIndex - 1);
            super.m_errStatus = 0;
            super.m_errIndex = 0;
        }
    }

    @Override
    public SnmpSyntax duplicate() {
        return new SnmpPduRequest(this);
    }

    @Override
    public Object clone() {
        return new SnmpPduRequest(this);
    }
}
